<?php
	function mlink($text,$block) {
		$html = '<a name="block'.$block.'" href="?edit='.$block.'#block'.msplit($block).'">'.$text.'</a>';			
		return $html;
	}
	function minput($text,$block) {
		$html = '<a name="block'.$block.'"></a>';
		$html.= '<form name="modify" action="?show#block'.msplit($block).'" method="POST">'."\n";
		$html.= mcontrol();
		$html.= '<input name="data" type="text" value="'.$text.'" />';
		$html.= '<input type="hidden" name="task" value="" />'."\n";					
		$html.= '<input type="hidden" name="block" value="'.$block.'" />'."\n";					
		$html.= '</form>';
		return $html; 
	}
	function mtextarea($text,$block) {
		$html = '<a name="block'.$block.'"></a>';
		$html.= '<form name="modify" action="?show#block'.msplit($block).'" method="POST">'."\n";
		$html.= mcontrol();
		$html.= '<textarea name="data">'.$text.'</textarea>'."\n";			
		$html.= '<input type="hidden" name="task" value="" />'."\n";					
		$html.= '<input type="hidden" name="block" value="'.$block.'" />'."\n";					
		$html.= '</form>';
		return $html;
	}
	function mcontrol() {
		$html.= '<div class="control">';				
		$html.= '<a href="javascript:void(0);" onclick="javascript:salva();">SALVA</a> '."\n";			
		$html.= '<a href="javascript:void(0);" onclick="javascript:chiudi();">CHIUDI</a> '."\n";			
		$html.= '<a href="javascript:void(0);" onclick="javascript:cancella();">CANCELLA</a> '."\n";			
		$html.= '<a href="javascript:void(0);" onclick="javascript:ampia();">AMPLIA</a> '."\n";			
		$html.= '<a href="javascript:void(0);" onclick="javascript:stringi();">STRINGI</a>'."\n";			
		$html.= '</div>';
		return $html;
	}
?>
